package com.qk.management.statemachine.status;

import lombok.Getter;

// BusinessStatus.java
@Getter
public enum BusinessStatus {
    // 待分配
    WAIT(1),
    // 已分配
    ASSIGNED(2),
    // 跟进中
    FOLLOWING(3),
    // 回收
    RECYCLE(4),
    // 客户
    CUSTOMER(5);

    private final int code;

    BusinessStatus(int code) {
        this.code = code;
    }

    public static BusinessStatus fromCode(int code) {
        for (BusinessStatus status : BusinessStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("未知的状态码: " + code);
    }
}
